#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;


vector<int> v(103);
int n, mrest[103][3];


int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++) cin >> v[i];
    for(int i = 1; i <= n; i++)
    {
        mrest[i][0] = max(max(mrest[i-1][0], mrest[i-1][1]), mrest[i-1][2]);
		mrest[i][1] = -1;
        mrest[i][2] = -1;

        if (v[i] == 1)  mrest[i][1] = max(mrest[i-1][2],mrest[i-1][0]) + 1;
		if (v[i] == 2)  mrest[i][2] = max(mrest[i-1][1],mrest[i-1][0]) + 1;
		if (v[i] == 3) 
        { 
            mrest[i][1] = max(mrest[i-1][2], mrest[i-1][0]) + 1;
            mrest[i][2] = max(mrest[i-1][1], mrest[i-1][0]) + 1;
        }  
    }
    cout << n - max(max(mrest[n][0],mrest[n][1]),mrest[n][2])<<endl;
}